import git
import pyperclip
from time import sleep, localtime, strftime
# gitpython 操作说明:https://baiyangcao.github.io/notes/2017/04/11/gitpython-tutorial.html

repo = git.Repo.init(path=r'D:\Downloads\GitHub\mySS')
#username = "username"
#password = "token"
#remote = f"https://{username}:{password}@github.com/someone/somepkg.git"

with open(r'D:\Downloads\GitHub\mySS\sslink64', 'w', encoding='utf-8') as file:
	file.write(pyperclip.paste())
print("文件写入完成，网络同步中...")
sleep(2)
repo.index.add(['sslink64'])
repo.index.commit(strftime("%m-%d %H:%M", localtime()))
origin = repo.remote(name='origin')
origin.push()
